import {  formatTime  } from '@/utils'
import i18n from '@/locales/index' 
const { t } = i18n.global

export const  columns = [
  {
    title: t('common.sequenceNo'), dataIndex: 'index', key: 'index', align: 'center', width: 60,
    customRender: ({ index }) => {
      return index + 1
    },
  },
  { title: t('sysManage.operator'), dataIndex: 'createBy', key: 'createBy', align: 'center', width: 150 },
  {
    title: t('sysManage.optTime'), dataIndex: 'startTime', key: 'startTime', align: 'center', width: 170, timeType: 'time',
    customRender: ({ text }) => {
      return formatTime(text, 'YYYY-MM-DD HH:mm:ss')
    }
  },
  { title: t('common.state'), dataIndex: 'resultCode', key: 'resultCode', align: 'center', width: 100  },
  { title: t('deviceManage.ipAddr'), dataIndex: 'userIp', key: 'userIp', align: 'center', width: 120 },
  { title: t('sysManage.menuName'), dataIndex: 'module', key: 'module', align: 'center', width: 150 },
  { title: t('sysManage.optType'), dataIndex: 'name', key: 'name', align: 'center', width: 130 },
  { title: t('sysManage.requestURL'), dataIndex: 'requestUrl', key: 'requestUrl', align: 'center', width: 200 },
  { title: t('sysManage.methodName'), dataIndex: 'requestMethod', key: 'requestMethod', align: 'center', width: 110 },
  { title: t('sysManage.requestParams'), dataIndex: 'javaMethodArgs', key: 'javaMethodArgs', align: 'center', width: 110 },
  { title: t('sysManage.returnParam'), dataIndex: 'resultData', key: 'resultData', align: 'center', width: 110 }
]
export const  logParams = [
  {  title: t('sysManage.operator'), key: 'createBy', disabled: true, show: true, type: 'input', maxLength: 29 },
  {  title: t('sysManage.optTime'), key: 'time', show: false  , type: 'time' },
  {  title: t('common.state'), key: 'resultCodeList' , show: true, type: 'select' },
  {  title: t('deviceManage.ipAddr'), key: 'userIp', type: 'input', maxLength: 29 },
  {  title: t('sysManage.menuName'), key: 'module', type: 'treeSelect'  },
  {  title: t('sysManage.optType'), key: 'name'  , type: 'input', maxLength: 29 }
]